<?php
	session_start();
	
	ini_set('default_charset','UTF-8');
	
	define(BASE, 	"/zend/admin");
	
	define(SYSTEM, 	"system/");
	define(APP, 	"app/");
	
	define(SYS_HELPERS, 	SYSTEM . "helpers/");

	define(APP_CONTROLLERS,	APP . "controllers/");
	define(APP_EXTRAS, 		APP . "extras/");
	define(APP_INTERFACES,	APP . "interfaces/");
	define(APP_MODELS, 		APP . "models/");
	define(APP_TRANSIENT, 	APP . "transient/");
	define(APP_VIEWS, 		APP . "views/");

	function __autoload($classe) {
		$paths[] = SYSTEM;
		$paths[] = SYS_HELPERS;
		$paths[] = APP_CONTROLLERS;
		$paths[] = APP_INTERFACES;
		$paths[] = APP_EXTRAS;
		$paths[] = APP_MODELS;
		$paths[] = APP_TRANSIENT;
		for($i=0;$i<count($paths);$i++){
			$file = $paths[$i].$classe.".php";
			if( file_exists( $file ) ){
				require_once( $file );
				break;
			}
		}
	}
	
	//setlocale(LC_TIME, "pt_BR");
	//strftime($format, $timestamp); // similar a date($format, $timestamp), sendo que se orienta pelo Locale.
	
	$start = new System();
	$start->run();
	
?>